#ifndef _OKNOGLOWNE_H
#define	_OKNOGLOWNE_H

#include <boost\asio.hpp>
#include "Form1.h"
//#include "wyjatki.h"
//#include "obserwator.h"
//#include "obiektobserwowalny.h"
#include <algorithm>
#include <cliext\vector>
#include <cliext\map>
#include "klient.hpp"
#include <map>


ref class Klient;

using namespace System;
using namespace System::Collections;
using namespace System::ComponentModel;
using namespace System::Data;
using namespace System::Drawing;
using namespace System::Threading;
using namespace System::Windows::Forms;

using namespace ZedGraph;

   
public ref class OknoGlowne : public Form1 {
   public:
   OknoGlowne();

   System::Void buttonSamonastrajanie_Click(System::Object^, System::EventArgs^); 
   System::Void trackBarProbkowanie_Scroll(System::Object^, System::EventArgs^);
   System::Void numericUpDownProbkowanie_ValueChanged(System::Object^, System::EventArgs^);
   System::Void buttonReset_Click(System::Object^, System::EventArgs^);
   System::Void buttonZaloguj_Click(System::Object^, System::EventArgs^);
   System::Void buttonStop_Click(System::Object^, System::EventArgs^);

   System::Void buttonOkObiekt_Click(System::Object^ , System::EventArgs^);
   System::Void buttonOkRegulator_Click(System::Object^ , System::EventArgs^);
   System::Void buttonOkWartZad_Click(System::Object^ , System::EventArgs^);
   System::Void dodajMapeDoDataGrid(const std::map<std::string,std::string>&, System::Windows::Forms::DataGridView^);
   System::Void dodajMapeDoComboBox(cliext::map<System::String^,int>, System::Windows::Forms::ComboBox^);
   System::Void dodajWektorDoListBox(cliext::vector<System::String^>, System::Windows::Forms::ListBox^);

   System::Void listBoxWartZad_SelectedIndexChanged(System::Object^, System::EventArgs^);

   System::Void usunDyskretne();
   System::Void wczytajKonfiguracje();
   System::Void buttonWczytaj_Click(System::Object^ , System::EventArgs^); 
   System::Void buttonZapisz_Click(System::Object^ , System::EventArgs^);
   System::Void Reset();
   /*      std::string ToStdString(System::String^);
	   System::String^ ToSysString(std::string);*/
   System::Void dodajPktWykresu (double x, double y1, double y2, double y3 );
   System::Void Zamknij();
   System::Void buttonZamknij_Click(System::Object^, System::EventArgs^);
   System::Void buttonStart_Click(System::Object^, System::EventArgs^);
   System::Void inicjalizacja();
   //wekt.begin(),System::Void dodajPktWykresu(cliext::vector<double>);
   std::map<std::string,std::string> dataGridDoMapy(System::String^, System::Windows::Forms::DataGridView^);
   System::Void buttonZmienParamGeneratora_Click(System::Object^, System::EventArgs^);
   System::Void buttonZmienParamRegulatora_Click(System::Object^, System::EventArgs^);

   System::Void zmianaObiektu(std::map<std::string,std::string>);
   System::Void zmianaRegulatora(std::map<std::string,std::string>);
   System::Void nowaListaUstawionychGeneratorow (cliext::vector<System::String^>
						 wektor);
   System::Void zmianaWartZad(std::map<std::string,std::string> konfig);
   System::Void nowaMapaObiektow(cliext::map<System::String^,int> mapa);
   System::Void nowaMapaRegulatorow(cliext::map<System::String^,int> mapa);
   System::Void nowaMapaWartZad(cliext::map<System::String^,int> mapa);
   System::Void czyscRegulator();
   System::Void dodajMapeCLIDoDataGrid(cliext::map<System::String^,System::String^> konfig, System::Windows::Forms::DataGridView^  docelowyDataGrid);

   
	System::Void OknoGlowne::dodajRegulator();
	System::Void OknoGlowne::dodajObiekt();
	System::Void dodajListeGeneratorow();
	System::Void dodajMapeRegulatorow();
	System::Void dodajMapeGeneratorow();
	System::Void dodajMapeObiektow();

   //System::Void OknoGlowne::resetSymulacji();

   std::string ToStdString(System::String^ source) {
      std::string result;
      int len = source->Length;
      for (int i=0; i<len; i++)
	 result += (char)source[i];
      return result;
   }
      
   System::String^ ToSysString(std::string source) {
      System::String^ result;
      int len = (int)source.length();
      for (int i=0; i<len; i++)
	 result += (wchar_t)source[i];
      return result;
   }

		
   private:         
   Klient^ klient;
		 
};
	

#endif	/* _OKNOGLOWNE_H */
